package com.sunny.ihealth.utils;

import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

/**
 * 输入法相关小工具
 * Created by Sunny  An on 2015/9/30.
 */
public class SoftInputUtils {

    public static void hideSoftInput(Context context, View v) {
        if (v != null) {
            InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
            inputMethodManager.hideSoftInputFromWindow(v.getWindowToken(), 0);
        }
    }
}
